package cn.edu.neosoft.sunbo509.finefood.Service;

import java.util.List;

import cn.edu.neosoft.sunbo509.finefood.Bean.ChangecommentBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.CollectdishesBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.CollectshopBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.CommentBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.DishesdetailBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.GetcollectBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.IscollectBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.LoginBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.PurchaseBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.RegisterBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.SearchBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.ShopdetailBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.ShoplistBean;
import cn.edu.neosoft.sunbo509.finefood.Bean.UserBean;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by 小博 on 2017/10/18.
 */

public interface Service {
    //登陆
    @GET("userLogin.do")
    Call<LoginBean> getLogin(@Query("username")String username,
                             @Query("userpass")String userpass
    );
    //注册
    @GET("userRegister.do")
    Call<RegisterBean>getRegister(
            @Query("username") String  username,
            @Query("userpass") String userpass,
            @Query("mobilenum") String phone,
            @Query("address") String address,
            @Query("comment")  String comment
    );
    //店铺列表
    @GET("getAllShops.do")
    Call<List<ShoplistBean>>getShop();
    //店铺详情
    @GET("getFoodByShop.do")
    Call<List<ShopdetailBean>>getDatail(@Query("shop_id") int shop_id
    );
    //菜品详情
    @GET("getFoodById.do")
    Call<DishesdetailBean> getDishes(
            @Query("food_id") int food_id
    );
    //获取菜品评论
    @GET("getAllUserFoodOrder.do")
    Call<List<CommentBean>>getComment(
            @Query("food_id") int food_id
    );

   //购买
    @GET("insertOrder.do")
    Call<PurchaseBean> getpurchaseValue(
            @Query("user_id")  int user_id,
            @Query("food_id")  int food_id,
            @Query("num")  int num,
            @Query("sum") double sum,
            @Query("suggesttime")  String suggesttime
    );

    //判断收藏
    @GET("isCollected.do")
    Call<IscollectBean>getValue(@Query("user_id") int user_id,
                                @Query("shop_food_id") int shop_food_id,
                                @Query("flag") int flag
    );
    //收藏/取消店铺
    @GET("userCollectShop.do")
    Call<CollectshopBean>getshopValue(
            @Query ("user_id") int user_id,
            @Query("shop_id") int shop_id
    );
    //收藏/取消菜品
    @GET("userCollectFood.do")
    Call<CollectdishesBean> getdishesValue(
            @Query("user_id") int user_id,
            @Query("food_id") int food_id
    );
    //获取收藏
    @GET("getAllUserCollection.do")
    Call<List<GetcollectBean>>getMessage(
            @Query("user_id") int user_id,
            @Query("flag")  int flag
    );
    //搜索
    @GET("getFoodBySearch.do")
    Call<List<SearchBean>>searchDish(
            @Query("search") String search
    );
    //获取注册用户信息
    @GET("getUserById.do")
    Call<UserBean>getUser(
            @Query("user_id") String user_id
    );
    //获取当前用户的所有订单信息
    @GET("getAllUserOrder.do")
    Call<List<CommentBean>>getOrder(
            @Query("user_id") String user_id
    );
    //获取用户的评论
    @GET("getAllUserComment.do")
    Call<List<CommentBean>>getUsercomment(
            @Query("user_id") String user_id
    );
    //增加评论
    @GET("insertComment.do")
    Call<ChangecommentBean>addCommentValue(@Query("order_id") int order_id,
                                           @Query("content") String content);
}
